package com.topisv.tms.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.topisv.tms.entity.OrdenoSource;
import com.topisv.tms.entity.QueryParamHolder;
import com.topisv.tms.repository.OrdenoSourceDao;
import com.topisv.tms.service.base.BaseService;

//Spring Bean的标识.
@Component
// 默认将类中的所有public函数纳入事务管理.
@Transactional(readOnly = true)
public class OrdenoSourceService extends BaseService{

	@Autowired
	private OrdenoSourceDao ordenoSourceDao;
	

	
	public OrdenoSource findByOrdenoSourceCode(String ordenoSourceCode){
		return ordenoSourceDao.findByOrdenoSourceCode(ordenoSourceCode);
	}
	
	@Transactional(readOnly = false)
	public OrdenoSource save(OrdenoSource arg0){
		return ordenoSourceDao.save(arg0);
	}
	
	@Transactional(readOnly = false)
	public List<OrdenoSource> save(List<OrdenoSource> arg0){
		return (List<OrdenoSource>) ordenoSourceDao.save(arg0);
	}
	
	public List<OrdenoSource> findAll(){
		return (List<OrdenoSource>) ordenoSourceDao.findAll();
	}
	
	public OrdenoSource findOne(Long arg0){
		return ordenoSourceDao.findOne(arg0);
	} 
	
	public Page<OrdenoSource> pageOrdenoSource(QueryParamHolder paramHolder) {
		return findByJson(paramHolder, ordenoSourceDao, OrdenoSource.class);
	}

}
